package com.es.disped.dao.mapper;

import com.es.disped.dao.model.Feedback;
import com.es.disped.dao.model.FeedbackExample;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

//@CacheNamespace(implementation=(com.es.disped.dao.cache.RedisCache.class),size=512,flushInterval=60000)
public interface FeedbackMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table feedback
     *
     * @mbg.generated Sun Jul 07 11:47:52 CST 2019
     */
    @SelectProvider(type=FeedbackSqlProvider.class, method="countByExample")
    long countByExample(FeedbackExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table feedback
     *
     * @mbg.generated Sun Jul 07 11:47:52 CST 2019
     */
    @DeleteProvider(type=FeedbackSqlProvider.class, method="deleteByExample")
    int deleteByExample(FeedbackExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table feedback
     *
     * @mbg.generated Sun Jul 07 11:47:52 CST 2019
     */
    @Delete({
        "delete from feedback",
        "where feedback_id = #{feedbackId,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(String feedbackId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table feedback
     *
     * @mbg.generated Sun Jul 07 11:47:52 CST 2019
     */
    @Insert({
        "insert into feedback (feedback_id, lesson_id, ",
        "lesson_name, student_id, ",
        "student_name, feedback_star, ",
        "feedback_date, feedback_content)",
        "values (#{feedbackId,jdbcType=CHAR}, #{lessonId,jdbcType=CHAR}, ",
        "#{lessonName,jdbcType=VARCHAR}, #{studentId,jdbcType=CHAR}, ",
        "#{studentName,jdbcType=VARCHAR}, #{feedbackStar,jdbcType=INTEGER}, ",
        "#{feedbackDate,jdbcType=VARCHAR}, #{feedbackContent,jdbcType=LONGVARCHAR})"
    })
    int insert(Feedback record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table feedback
     *
     * @mbg.generated Sun Jul 07 11:47:52 CST 2019
     */
    @InsertProvider(type=FeedbackSqlProvider.class, method="insertSelective")
    int insertSelective(Feedback record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table feedback
     *
     * @mbg.generated Sun Jul 07 11:47:52 CST 2019
     */
    @SelectProvider(type=FeedbackSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="feedback_id", property="feedbackId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="lesson_id", property="lessonId", jdbcType=JdbcType.CHAR),
        @Result(column="lesson_name", property="lessonName", jdbcType=JdbcType.VARCHAR),
        @Result(column="student_id", property="studentId", jdbcType=JdbcType.CHAR),
        @Result(column="student_name", property="studentName", jdbcType=JdbcType.VARCHAR),
        @Result(column="feedback_star", property="feedbackStar", jdbcType=JdbcType.INTEGER),
        @Result(column="feedback_date", property="feedbackDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="feedback_content", property="feedbackContent", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<Feedback> selectByExampleWithBLOBs(FeedbackExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table feedback
     *
     * @mbg.generated Sun Jul 07 11:47:52 CST 2019
     */
    @SelectProvider(type=FeedbackSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="feedback_id", property="feedbackId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="lesson_id", property="lessonId", jdbcType=JdbcType.CHAR),
        @Result(column="lesson_name", property="lessonName", jdbcType=JdbcType.VARCHAR),
        @Result(column="student_id", property="studentId", jdbcType=JdbcType.CHAR),
        @Result(column="student_name", property="studentName", jdbcType=JdbcType.VARCHAR),
        @Result(column="feedback_star", property="feedbackStar", jdbcType=JdbcType.INTEGER),
        @Result(column="feedback_date", property="feedbackDate", jdbcType=JdbcType.VARCHAR)
    })
    List<Feedback> selectByExample(FeedbackExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table feedback
     *
     * @mbg.generated Sun Jul 07 11:47:52 CST 2019
     */
    @Select({
        "select",
        "feedback_id, lesson_id, lesson_name, student_id, student_name, feedback_star, ",
        "feedback_date, feedback_content",
        "from feedback",
        "where feedback_id = #{feedbackId,jdbcType=CHAR}"
    })
    @Results({
        @Result(column="feedback_id", property="feedbackId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="lesson_id", property="lessonId", jdbcType=JdbcType.CHAR),
        @Result(column="lesson_name", property="lessonName", jdbcType=JdbcType.VARCHAR),
        @Result(column="student_id", property="studentId", jdbcType=JdbcType.CHAR),
        @Result(column="student_name", property="studentName", jdbcType=JdbcType.VARCHAR),
        @Result(column="feedback_star", property="feedbackStar", jdbcType=JdbcType.INTEGER),
        @Result(column="feedback_date", property="feedbackDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="feedback_content", property="feedbackContent", jdbcType=JdbcType.LONGVARCHAR)
    })
    Feedback selectByPrimaryKey(String feedbackId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table feedback
     *
     * @mbg.generated Sun Jul 07 11:47:52 CST 2019
     */
    @UpdateProvider(type=FeedbackSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Feedback record, @Param("example") FeedbackExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table feedback
     *
     * @mbg.generated Sun Jul 07 11:47:52 CST 2019
     */
    @UpdateProvider(type=FeedbackSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") Feedback record, @Param("example") FeedbackExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table feedback
     *
     * @mbg.generated Sun Jul 07 11:47:52 CST 2019
     */
    @UpdateProvider(type=FeedbackSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Feedback record, @Param("example") FeedbackExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table feedback
     *
     * @mbg.generated Sun Jul 07 11:47:52 CST 2019
     */
    @UpdateProvider(type=FeedbackSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Feedback record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table feedback
     *
     * @mbg.generated Sun Jul 07 11:47:52 CST 2019
     */
    @Update({
        "update feedback",
        "set lesson_id = #{lessonId,jdbcType=CHAR},",
          "lesson_name = #{lessonName,jdbcType=VARCHAR},",
          "student_id = #{studentId,jdbcType=CHAR},",
          "student_name = #{studentName,jdbcType=VARCHAR},",
          "feedback_star = #{feedbackStar,jdbcType=INTEGER},",
          "feedback_date = #{feedbackDate,jdbcType=VARCHAR},",
          "feedback_content = #{feedbackContent,jdbcType=LONGVARCHAR}",
        "where feedback_id = #{feedbackId,jdbcType=CHAR}"
    })
    int updateByPrimaryKeyWithBLOBs(Feedback record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table feedback
     *
     * @mbg.generated Sun Jul 07 11:47:52 CST 2019
     */
    @Update({
        "update feedback",
        "set lesson_id = #{lessonId,jdbcType=CHAR},",
          "lesson_name = #{lessonName,jdbcType=VARCHAR},",
          "student_id = #{studentId,jdbcType=CHAR},",
          "student_name = #{studentName,jdbcType=VARCHAR},",
          "feedback_star = #{feedbackStar,jdbcType=INTEGER},",
          "feedback_date = #{feedbackDate,jdbcType=VARCHAR}",
        "where feedback_id = #{feedbackId,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(Feedback record);
}